Skip to content

Conversation

@lunny
Copy link
Member

@lunny lunny commented Dec 18, 2025

Maybe fix #32018

  • Use gitrepo.GetMergeBase method instead of other two implementations.
  • Add FetchRemoteCommit so that we don't need to add many remote to the git repository to avoid possible git lock conflicts. A lock will start when invoke the function, it will be invoked when cross-repository comparing. The head repository will fetch the base repository's base commit id. In most situations, it should lock the fork repositories so that it should not become a bottleneck.
  • Improve GetCompareInfo to remove unnecessarily adding remote.
  • Remove unnecessary parameters of SignMerge.

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Dec 18, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 18, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Dec 18, 2025
@lunny lunny marked this pull request as draft December 25, 2025 07:19
lafriks pushed a commit that referenced this pull request Dec 28, 2025
@lunny lunny changed the title Some refactors to reduce RepoPath Some refactors about GetMergeBase Dec 29, 2025
@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Jan 3, 2026
@lunny lunny marked this pull request as ready for review January 3, 2026 04:40
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 3, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 4, 2026
@wxiaoguang
Copy link
Contributor

CI failure is also related.

Do rerun the CI multiple times before merge to ensure there is no regression.

CI failure is still related

     pull_create_test.go:98: 
        	Error Trace:	/home/runner/work/gitea/gitea/tests/integration/integration_test.go:348
        	            				/home/runner/work/gitea/gitea/tests/integration/integration_test.go:160
        	            				/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:98
        	            				/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:399
        	            				/opt/hostedtoolcache/go/1.25.5/x64/src/sync/waitgroup.go:239
        	            				/opt/hostedtoolcache/go/1.25.5/x64/src/runtime/asm_amd64.s:1693
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 500
        	Test:       	TestPullCreateParallel
        	Messages:   	Request: GET /user2/repo1/compare/master...user1/repo1:new-branch-3


    pull_create_test.go:416: 
        	Error Trace:	/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:416
        	            				/home/runner/work/gitea/gitea/tests/integration/git_helper_for_declarative_test.go:88
        	            				/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:384
        	Error:      	Not equal: 
        	            	expected: 8
        	            	actual  : 7
        	Test:       	TestPullCreateParallel
    pull_create_test.go:417: 
        	Error Trace:	/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:417
        	            				/home/runner/work/gitea/gitea/tests/integration/git_helper_for_declarative_test.go:88
        	            				/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:384
        	Error:      	Not equal: 
        	            	expected: 8
        	            	actual  : 7
        	Test:       	TestPullCreateParallel

@github-actions github-actions bot removed the modifies/api This PR adds API routes or modifies them label Jan 14, 2026
@lunny
Copy link
Member Author

lunny commented Jan 16, 2026

CI failure is also related.

Do rerun the CI multiple times before merge to ensure there is no regression.

Added a lock for the fetch operations to the repository and rerun the CI many times and all PASS.

@lunny lunny marked this pull request as ready for review January 17, 2026 05:12
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 17, 2026
@lunny lunny merged commit fafd1db into go-gitea:main Jan 17, 2026
24 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Jan 17, 2026
@lunny lunny deleted the lunny/some_refactors branch January 17, 2026 19:22
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 17, 2026
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 21, 2026
* giteaofficial/main: (27 commits)
  Allow foreachref parse max tokens from 4*64KB to 4MB (go-gitea#36414)
  Refactor git command context & pipeline (go-gitea#36406)
  Fix missing repository id when migrating release attachments (go-gitea#36389)
  [skip ci] Updated translations via Crowdin
  Refactor git command stderr handling (go-gitea#36402)
  Some refactors about GetMergeBase (go-gitea#36186)
  Refactor git command stdio pipe (go-gitea#36393)
  fix: typos in comments (go-gitea#36394)
  add support for archive-upload rpc (go-gitea#36391)
  Hide delete directory button for mirror or archive repository and disable the menu item if user have no permission (go-gitea#36384)
  Fix CODEOWNERS review request attribution using comment metadata (go-gitea#36348)
  Update JS and PY deps (go-gitea#36383)
  Add ability to download subpath archive (go-gitea#36371)
  Fix bug on notification read (go-gitea#36339)
  Add chunked transfer encoding support for LFS uploads (go-gitea#36380)
  Migrate to `import.meta.env` and clean up types and eslint (go-gitea#36362)
  Rename CSS variables and improve colorblind themes (go-gitea#36353)
  Indicate when only optional checks failed (go-gitea#36367)
  Release attachments must belong to the intended repo (go-gitea#36347)
  Fix permission check on org project operations (go-gitea#36318)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code type/refactoring Existing code has been cleaned up. There should be no new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GetCompareInfo, AddRemote: exit status 128 - error: could not lock config file config: File exists

5 participants